package com.woori.web;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class LifeServlet
 */
public class LifeServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	ServletConfig config;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public LifeServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		System.out.println("servlet doing get...");
		System.out.println("servlet name="+config.getServletName());
		response.getWriter().print("servlet email="+config.getInitParameter("email"));
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		System.out.println("doing post...");
		
	}

//	public void service(ServletRequest arg0, ServletResponse arg1)
//			throws ServletException, IOException {
//		System.out.println("servlet service connected...");
//		
//	}

	public void destroy() {
		System.out.println("servlet destroyed...");
	}

	public void init(ServletConfig config) throws ServletException {
		System.out.println("servlet initialized...");
		this.config = config;
	}

	
	
}
